//
//  YHOptionLayoutItemStyles.m
//  ScriptKill
//
//  Created by 林宁宁 on 2021/4/28.
//  Copyright © 2021 优智汇. All rights reserved.
//

#import "YHOptionLayoutItemStyles.h"
#import "UIFont+YH.h"

#import "YHOptionTitleTableViewCell.h"
#import "YHOptionTitleTextInputTableViewCell.h"
#import "YHOptionTitleCheckBoxTableViewCell.h"
#import "YHOptionTitleTwoBoxsPickerTableViewCell.h"
#import "YHOptionTitleImageListTableViewCell.h"
#import "YHOptionTitleTagsTableViewCell.h"
#import "YHOptionTitleTextViewInputTableViewCell.h"
#import "YHOptionTitleSwitchTableViewCell.h"
#import "YHOptionTitleCustomViewTableViewCell.h"
#import "YHOptionTitleCenterTableViewCell.h"
#import "YHOptionTitleContentTableViewCell.h"
#import "YHOptionTitleTableViewPickerInfoCell.h"

#import "UITextView+YHPlaceholder.h"
#import "UITextField+YHInputLimit.h"
#import "UITextView+YHInputLimit.h"
#import "UILabel+TapAttribute.h"
#import "YHUniqueID.h"

/// 空行
/// @param height 空行的高度
YHOptionTableViewItem * YHOptionTableItemInitSpace(CGFloat height){
    YHOptionTableViewItem * item = [YHOptionTableViewItem new];
    item.layout.cellHeight = height;
    item.layout.cellBgColor = [UIColor yh_background];
    item.layout.showAccessoryArrowView = NO;
    item.layout.showBottomLine = NO;
    item.cellClass = YHOptionTitleTableViewCell.class;
    item.cellIdentify = YHOptionTitleTableViewCell.cellIndentify;
    return item;
}
/// 标题
YHOptionTableViewItem * YHOptionTableItemInitTitle(NSString * title, BOOL showRightArrow, BOOL showBottomLine){
    YHOptionTableViewItem * item = [YHOptionTableViewItem new];
    item.leftContent.title = title;
    item.layout.showAccessoryArrowView = showRightArrow;
    item.layout.showBottomLine = showBottomLine;
    item.cellClass = YHOptionTitleTableViewCell.class;
    item.cellIdentify = YHOptionTitleTableViewCell.cellIndentify;
    return item;
}
/// 标题内容
YHOptionTableViewItem * YHOptionTableItemInitTitleContentStyle(NSString * _Nullable title, NSString * _Nullable content, UIFont * _Nullable font, UIColor * _Nullable color){
    YHOptionTableViewItem * item = [YHOptionTableViewItem new];
    item.leftContent.title = title;
    item.content = content;
    item.layout.showAccessoryArrowView = NO;
    item.layout.showBottomLine = NO;
    item.cellClass = YHOptionTitleContentTableViewCell.class;
    item.cellIdentify = YHOptionTitleContentTableViewCell.cellIndentify;
    [item setCellShowBlock:^(YHOptionTitleContentTableViewCell * _Nonnull cell, YHOptionTableViewItem * _Nonnull passItem) {
        cell.cellContentLabel.text = passItem.content;
        cell.cellContentLabel.textColor = color?:[UIColor yh_h1];
        cell.cellContentLabel.font = font?:[UIFont yh_pfOfSize:14];
    }];
    return item;
}
YHOptionTableViewItem * YHOptionTableItemInitTitleContent(NSString * _Nullable title, NSString * _Nullable content){
    return YHOptionTableItemInitTitleContentStyle(title, content, nil, nil);
}

/// 标题 指示器 左边有一个图片指示器
YHOptionTableViewItem * YHOptionTableItemInitTitleIndicator(NSString * _Nullable title){
    YHOptionTableViewItem * itemIndicator = YHOptionTableItemInitTitle(title, NO, NO);
    itemIndicator.layout.leftShowType = YHOptionCellLeftShowType_Image | YHOptionCellLeftShowType_Title;
    itemIndicator.leftContent.imageURL = @"optionIndicator";
    return itemIndicator;
}

/// 图标 加 标题
YHOptionTableViewItem * YHOptionTableItemInitIconTitle(NSString * _Nullable title, NSString * _Nullable imageName, BOOL showRightArrow, BOOL showBottomLine){
    YHOptionTableViewItem * item = [YHOptionTableViewItem new];
    item.leftContent.title = title;
    item.leftContent.imageURL = imageName;
    item.layout.leftShowType = YHOptionCellLeftShowType_Title | YHOptionCellLeftShowType_Image;
    item.layout.showAccessoryArrowView = showRightArrow;
    item.layout.showBottomLine = showBottomLine;
    item.layout.isFullCell = YES;
    item.cellClass = YHOptionTitleTableViewCell.class;
    item.cellIdentify = YHOptionTitleTableViewCell.cellIndentify;
    return item;
}

/// 标题 内容选择
/// @param title 标题
/// @param placeholder 预设提示文案
YHOptionTableViewItemPickerInfo * YHOptionTableItemInitTitleContentPicker(NSString * title, NSString * _Nullable placeholder){
    
    YHOptionTableViewItemPickerInfo * item = [YHOptionTableViewItemPickerInfo new];
    item.leftContent.title = title;
    item.placeholder = placeholder;
    item.cellClass = YHOptionTitleTableViewPickerInfoCell.class;
    item.cellIdentify = YHOptionTitleTableViewPickerInfoCell.cellIndentify;
    [item setCellShowBlock:^(YHOptionTitleTableViewPickerInfoCell * _Nonnull cell, YHOptionTableViewItemPickerInfo * _Nonnull passItem) {
        cell.placeholder = passItem.placeholder;
        cell.info = passItem.content;
    }];
    return item;
}

/// 输入框
/// @param title 标题
/// @param placeholder 预设提示文案
YHOptionTableViewItemInputTextFiled * YHOptionTableItemInitTitleInputTextField(NSString * title, NSString * _Nullable placeholder, NSInteger maxTextCount){
    YHOptionTableViewItemInputTextFiled * item = [YHOptionTableViewItemInputTextFiled new];
    item.leftContent.title = title;
    item.placeholder = placeholder;
    item.editAble = YES;
    item.maxTextCount = maxTextCount;
    item.cellClass = YHOptionTitleTextInputTableViewCell.class;
    item.cellIdentify = YHOptionTitleTextInputTableViewCell.cellIndentify;
    [item setCellShowBlock:^(YHOptionTitleTextInputTableViewCell * _Nonnull cell, YHOptionTableViewItemInputTextFiled * _Nonnull passItem) {
        if(passItem.maxTextCount){
            cell.cellTextFiled.yh_maxLength = passItem.maxTextCount;
        }else{
            cell.cellTextFiled.yh_maxLength = 500;
        }
        if(passItem.content.length > passItem.maxTextCount){
            cell.cellTextFiled.text = [passItem.content substringToIndex:passItem.maxTextCount];
        }else{
            cell.cellTextFiled.text = passItem.content;
        }
        cell.cellTextFiled.placeholder = passItem.placeholder;
        
        cell.cellTextFiled.userInteractionEnabled = passItem.editAble;
        cell.cellTextFiled.keyboardType = passItem.keyboardType;
        
        [cell setEditChangeBlock:^(NSString * _Nonnull passValues, YHOptionTitleTextInputTableViewCell * passCell) {
            if(passItem.textInputChangeBlock){
                passItem.textInputChangeBlock(passValues, passItem);
            }
        }];
        [cell setEditEndBlock:^(NSString * _Nonnull passValues, YHOptionTitleTextInputTableViewCell * passCell) {
            NSString * content = [passValues stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
            passItem.content = content;
            if(![content isEqualToString:passValues]){
                passCell.cellTextFiled.text = content;
            }
            if(passItem.textInputFinishBlock){
                passItem.textInputFinishBlock(content, passItem);
            }
        }];
    }];
    return item;
}

/// 输入框
/// @param title 标题
/// @param maxTextCount 最大字符数量
YHOptionTableViewItemInputTextView * YHOptionTableItemInitTitleInputTextView(NSString * _Nullable title, NSInteger maxTextCount, BOOL isFullCell){
    
    YHOptionTableViewItemInputTextView * item = [YHOptionTableViewItemInputTextView new];
    item.leftContent.title = title;
    item.layout.showAccessoryArrowView = NO;
    item.layout.cellHeight = 120;
    item.editAble = YES;
    item.maxTextCount = maxTextCount;
    item.cellClass = YHOptionTitleTextViewInputTableViewCell.class;
    item.cellIdentify = YHOptionTitleTextViewInputTableViewCell.cellIndentify;
    item.layout.isFullCell = isFullCell;
    [item setCellShowBlock:^(YHOptionTitleTextViewInputTableViewCell * _Nonnull cell, YHOptionTableViewItemInputTextView * _Nonnull passItem) {
        cell.cellTextView.textColor = passItem.textColor?:[UIColor yh_h1];
        
        cell.cellTextView.placeholder = passItem.placeholder;
        cell.cellTextView.placeholderColor = passItem.placeholderColor?:[UIColor yh_placeholder];
        
        cell.cellTextView.backgroundColor = passItem.textViewBgColor?:[UIColor clearColor];
        cell.cellTextView.layer.cornerRadius = passItem.textViewCornerRadius;
        cell.cellTextView.layer.masksToBounds = YES;
        cell.cellTextView.textContainerInset = passItem.textViewContentInset;
        
        cell.cellTextView.text = passItem.content;
        cell.cellTextView.editable = passItem.editAble;
        cell.cellTextView.selectable = passItem.editAble;
        cell.cellTextView.keyboardType = passItem.keyboardType;
        if(passItem.maxTextCount){
            cell.cellTextView.yh_maxLength = passItem.maxTextCount;
        }else{
            cell.cellTextView.yh_maxLength = 2000;
        }
        [cell setEditChangeBlock:^(NSString * _Nonnull passValues) {
            if(passItem.textInputChangeBlock){
                passItem.textInputChangeBlock(passValues, passItem);
            }
        }];
        [cell setEditEndBlock:^(NSString * _Nonnull passValues) {
            if(passItem.textInputFinishBlock){
                passItem.textInputFinishBlock(passValues, passItem);
            }
            passItem.content = [passValues stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
        }];
    }];
    return item;
}

/// 单选框
/// @param title 标题
/// @param menus 单选按钮菜单
YHOptionTableViewItemCheckBox * YHOptionTableItemInitTitleCheckBoxSingle(NSString * title, NSArray <NSString *> * menus){
    YHOptionTableViewItemCheckBox * item = [YHOptionTableViewItemCheckBox new];
    item.leftContent.title = title;
    item.checkMenus = menus;
    item.layout.showAccessoryArrowView = NO;
    item.pickerContents = menus.firstObject;
    item.cellClass = YHOptionTitleCheckBoxTableViewCell.class;
    item.cellIdentify = YHOptionTitleCheckBoxTableViewCell.cellIndentify;
    [item setCellShowBlock:^(__kindof YHOptionTitleCheckBoxTableViewCell * _Nonnull cell, YHOptionTableViewItemCheckBox * _Nonnull passItem) {
        [cell.cellCheckBox addCheckTitles:passItem.checkMenus];
        if([passItem.checkMenus containsObject:passItem.pickerContents]){
            [cell.cellCheckBox selectCheckTitle:passItem.pickerContents];
        }
        
        [cell.cellCheckBox setClickCurrentBlock:^(YHCheckBoxItem * _Nonnull passCheck, NSInteger index, YHCheckBoxView * _Nonnull checkBox) {
            if(passItem.cellCheckBoxClickBlock){
                passItem.cellCheckBoxClickBlock(index, passCheck.title, passItem);
            }
        }];
    }];
    return item;
}

/// 两个选择框
YHOptionTableViewItemTwoBoxs * YHOptionTableItemInitTitleTwoBoxsPicker(NSString * title){
    YHOptionTableViewItemTwoBoxs * item = [YHOptionTableViewItemTwoBoxs new];
    item.leftContent.title = title;
    item.layout.showAccessoryArrowView = NO;
    item.cellClass = YHOptionTitleTwoBoxsPickerTableViewCell.class;
    item.cellIdentify = YHOptionTitleTwoBoxsPickerTableViewCell.cellIndentify;
    [item setCellShowBlock:^(YHOptionTitleTwoBoxsPickerTableViewCell * _Nonnull cell, YHOptionTableViewItemTwoBoxs * _Nonnull passItem) {
        
        cell.boxTextFiled1.text = passItem.boxValue1;
        cell.boxTextFiled2.text = passItem.boxValue2;
        
        cell.boxTextFiled1.placeholder = passItem.boxPlaceholder1;
        cell.boxTextFiled2.placeholder = passItem.boxPlaceholder2;
        
        cell.centerInfoLabel.text = passItem.centerTitle;
        
        cell.boxWidth1 = passItem.boxWidth;
        cell.boxWidth2 = passItem.boxWidth;
        cell.boxHeight1 = passItem.boxHeight;
        cell.boxHeight2 = passItem.boxHeight;
        
        if(passItem.hiddenBox2){
            cell.boxTextFiled2.hidden = YES;
        }else{
            cell.boxTextFiled2.hidden = NO;
        }
        
        [cell.boxTextFiled1 setBeginEditBlock:^BOOL(YHInputTextField * _Nonnull passTextField) {
            if(passItem.cellBoxsBeginEditBlock){
                return passItem.cellBoxsBeginEditBlock(YES,passTextField.text,passItem);
            }
            return YES;
        }];
        [cell.boxTextFiled2 setBeginEditBlock:^BOOL(YHInputTextField * _Nonnull passTextField) {
            if(passItem.cellBoxsBeginEditBlock){
                return passItem.cellBoxsBeginEditBlock(NO,passTextField.text,passItem);
            }
            return YES;
        }];
        [cell.boxTextFiled1 setEndEditBlock:^(YHInputTextField * _Nonnull passTextField) {
            if(passItem.cellBoxsEndEditBlock){
                passItem.cellBoxsEndEditBlock(YES, passTextField.text, passItem);
            }
        }];
        [cell.boxTextFiled2 setEndEditBlock:^(YHInputTextField * _Nonnull passTextField) {
            if(passItem.cellBoxsEndEditBlock){
                passItem.cellBoxsEndEditBlock(NO, passTextField.text, passItem);
            }
        }];
        
        if(passItem.cellBoxsEditConfigBlock){
            passItem.cellBoxsEditConfigBlock(cell.boxTextFiled1, cell.boxTextFiled2, passItem);
        }
    }];
    return item;
}

/// 图片列表 编辑选择 图片
/// @param imageList 图片信息
YHOptionTableViewItemImageList * YHOptionTableItemInitTitleImageListLook(NSString * _Nullable title, NSArray * imageList, BOOL isFullCell){
    YHOptionTableViewItemImageList * item = [YHOptionTableViewItemImageList new];
    item.leftContent.title = title;
    item.layout.showAccessoryArrowView = NO;
    item.cellClass = YHOptionTitleImageListTableViewCell.class;
    item.cellIdentify = YHOptionTitleImageListTableViewCell.cellIndentify;
    if(isFullCell){
        item.layout.cellHeight = 105;
        item.layout.isFullCell = YES;
    }
    item.isEdit = NO;
    item.passImageList = imageList;
    [item setCellShowBlock:^(YHOptionTitleImageListTableViewCell * _Nonnull cell, YHOptionTableViewItemImageList * passItem) {

        cell.imageList = passItem.resultImageList;
    }];
    return item;
    
    
}

/// 图片列表 可选择编辑
/// @param title 标题
/// @param imageList 图片信息
/// @param maxCount 最大数
/// @param isFullCell 是否铺满cell
YHOptionTableViewItemImageList * YHOptionTableItemInitTitleImageListEdit(NSString * _Nullable title, NSArray * imageList, NSInteger maxCount, BOOL isFullCell){
    YHOptionTableViewItemImageList * item = [YHOptionTableViewItemImageList new];
    item.leftContent.title = title;
    item.layout.showAccessoryArrowView = NO;
    item.cellClass = YHOptionTitleImageListTableViewCell.class;
    item.cellIdentify = YHOptionTitleImageListTableViewCell.cellIndentify;
    if(isFullCell){
        item.layout.cellHeight = 105;
        item.layout.isFullCell = YES;
    }
    item.maxImageCount = maxCount;
    item.isEdit = YES;
    item.passImageList = imageList;
    [item setCellShowBlock:^(YHOptionTitleImageListTableViewCell * _Nonnull cell, YHOptionTableViewItemImageList * passItem) {

        cell.imageList = passItem.resultImageList;
        cell.isEdit = passItem.isEdit;
        cell.maxImageCount = passItem.maxImageCount;
        
        [cell setDeleteImageAction:^(YHOptionTableViewImageItem * _Nonnull item) {
            [passItem.resultImageList removeObject:item];
            if(passItem.imageResultChangeBlock){
                passItem.imageResultChangeBlock(passItem, passItem.resultImageList);
            }
        }];
        [cell setAddImageAction:^(YHOptionTableViewImageItem * _Nonnull item) {
            [passItem.resultImageList addObject:item];
            if(passItem.imageResultChangeBlock){
                passItem.imageResultChangeBlock(passItem, passItem.resultImageList);
            }
        }];
    }];
    [item setImageResultChangeBlock:^(YHOptionTableViewItemImageList * _Nonnull passInfo, NSArray<YHOptionTableViewImageItem *> * _Nonnull resultList) {
        NSLog(@"图片编辑变化");
    }];
    return item;
}


/// 标签信息
/// @param title 标题
/// @param tags 标签数组
/// @param canLongPressEdit 是否长按可编辑
/// @param isFullCell 铺满cell
YHOptionTableViewItemTags * YHOptionTableItemInitTitleTags(NSString * _Nullable title, NSArray <NSString *>* tags, BOOL canLongPressEdit, BOOL isFullCell, NSInteger maxCount){
    
    YHOptionTableViewItemTags * item = [YHOptionTableViewItemTags new];
    item.leftContent.title = title;
    item.layout.showAccessoryArrowView = NO;
    item.cellClass = YHOptionTitleTagsTableViewCell.class;
    item.cellIdentify = YHOptionTitleTagsTableViewCell.cellIndentify;
    item.layout.isFullCell = isFullCell;
    item.passTags = tags;
    item.canLongPressToDelete = canLongPressEdit;
    item.maxCount = maxCount;
    [item setCellShowBlock:^(YHOptionTitleTagsTableViewCell * _Nonnull cell, YHOptionTableViewItemTags * passItem) {
        
        [cell.tagsView resetWithTags:[passItem allTags]];
        cell.tagsView.config.canLongpressToDelete = passItem.canLongPressToDelete;
        cell.tagsView.config.maxCount = maxCount;
        
        [cell.tagsView.config setDeleteTagBlock:^(NSString * _Nonnull tag, NSString * _Nonnull tagID, NSInteger tagIndex) {
            [passItem removeTag:tag];
            if(passItem.tagsChangeBlock){
                passItem.tagsChangeBlock([passItem allTags]);
            }
        }];
        if(passItem.canLongPressToDelete){
            [cell.tagsView.config setAddTagBlock:^(NSString * _Nonnull tag) {
                [passItem addTag:tag];
                if(passItem.tagsChangeBlock){
                    passItem.tagsChangeBlock([passItem allTags]);
                }
            }];
        }
    }];
    [item setTagsChangeBlock:^(NSArray<NSString *> * _Nonnull tags) {
        NSLog(@"标签变化：%@",tags);
    }];
    
    return item;
}

/// 开关信息
/// @param title 标题
YHOptionTableViewItemSwitch * YHOptionTableItemInitTitleSwitch(NSString * title){
    YHOptionTableViewItemSwitch * item = [YHOptionTableViewItemSwitch new];
    item.leftContent.title = title;
    item.layout.showAccessoryArrowView = NO;
    item.cellClass = YHOptionTitleSwitchTableViewCell.class;
    item.cellIdentify = YHOptionTitleSwitchTableViewCell.cellIndentify;
    [item setCellShowBlock:^(YHOptionTitleSwitchTableViewCell * _Nonnull cell, YHOptionTableViewItemSwitch * passItem) {
        cell.cellSwitch.on = passItem.isOn;
        [cell setSwitchChangeBlock:^(BOOL isOn) {
            if(passItem.switchChangeBlock){
                passItem.switchChangeBlock(passItem, isOn);
            }
        }];
    }];
    return item;
}

/// 提交按钮
YHOptionTableViewItemTitle * YHOptionTableItemSubmitButtonTitle(NSString * submitTitle, VoidBlock action){
    YHOptionTableViewItemTitle * submit = YHOptionTableItemInitFullTitle(submitTitle?:@"确定");
    submit.layout.spaceTop = 10;
    submit.layout.spaceColorTop = [UIColor clearColor];
    submit.titleRoundedCorners = 2;
    submit.titleBgColor = [UIColor yh_backgroundButton];
    submit.titleEdgesLeftRight = YHOptionLayout_Space15();
    [submit setCellClickBlock:^(NSIndexPath * _Nonnull indexPath, YHOptionTableViewItem * _Nonnull passItem) {
        if(action){
            action();
        }
    }];
    return submit;
}

/// 中间标题信息显示
YHOptionTableViewItemTitle * YHOptionTableItemInitFullTitle(NSString * centerTitle){
    YHOptionTableViewItemTitle * item = [YHOptionTableViewItemTitle new];
    item.leftContent.title = centerTitle;
    item.layout.showAccessoryArrowView = NO;
    item.layout.isFullNoneSpace = YES;
    item.cellClass = YHOptionTitleCenterTableViewCell.class;
    item.cellIdentify = YHOptionTitleCenterTableViewCell.cellIndentify;
    [item setCellShowBlock:^(YHOptionTitleCenterTableViewCell * _Nonnull cell, YHOptionTableViewItemTitle * passItem) {
        cell.contentView.backgroundColor = [UIColor clearColor];
        cell.cellContent.backgroundColor = [UIColor clearColor];
        cell.cellOptionContentView.backgroundColor = [UIColor clearColor];
        
        cell.centerTitleLable.textAlignment = passItem.alignment;
        cell.centerTitleLable.textColor = passItem.titleColor;
        cell.centerTitleLable.font = passItem.titleFont;
        
        if(passItem.titleAttribute){
            cell.centerTitleLable.attributedText = passItem.titleAttribute;
        }else{
            cell.centerTitleLable.text = passItem.leftContent.title;
        }
        if(passItem.clickTextIndexBlock){
            [cell.centerTitleLable setYh_tapBlock:^(UILabel * _Nonnull passLabel, NSInteger index, NSAttributedString * _Nonnull charAttributedString) {
                passItem.clickTextIndexBlock(passLabel.text,index,charAttributedString);
            }];
        }
        cell.centerTitleLable.backgroundColor = passItem.titleBgColor;
        cell.titleEdgesLeftRight = passItem.titleEdgesLeftRight;
        cell.centerTitleLable.layer.cornerRadius = passItem.titleRoundedCorners;
        cell.centerTitleLable.layer.masksToBounds = YES;
    }];
    return item;
}


/// 自定义视图
YHOptionTableViewItemCustomStyle * YHOptionTableItemInitTitleCustomView(NSString * _Nullable title, BOOL isFullNoneSpace, BOOL isFullNCell, CGFloat height){
    YHOptionTableViewItemCustomStyle * item = [YHOptionTableViewItemCustomStyle new];
    item.leftContent.title = title;
    item.layout.showAccessoryArrowView = NO;
    item.layout.cellHeight = height;
    item.layout.isFullNoneSpace = isFullNoneSpace;
    item.layout.isFullCell = isFullNCell;
    item.cellClass = YHOptionTitleCustomViewTableViewCell.class;
    item.cellIdentify = [YHUniqueID yh_timeID];
    [item setCellShowBlock:^(YHOptionTitleCustomViewTableViewCell * _Nonnull cell, YHOptionTableViewItemCustomStyle * passItem) {
        if(!cell.cellOptionCustomView){
            if(passItem.addCustomViewEdgeToContent){
                cell.cellOptionCustomView = passItem.addCustomViewEdgeToContent(cell.cellOptionContentView);
                [cell.cellOptionCustomView removeFromSuperview];
                [cell.cellOptionContentView addSubview:cell.cellOptionCustomView];
                [cell.cellOptionCustomView mas_makeConstraints:^(MASConstraintMaker *make) {
                    make.edges.equalTo(cell.cellOptionContentView);
                }];
            }
            else if(passItem.addCustomView){
                cell.cellOptionCustomView = passItem.addCustomView(cell.cellOptionContentView);
            }
        }
        if(!passItem.layout.cellHeightAuto){
            if(passItem.layout.cellHeight == 0){
                cell.cellOptionCustomView.hidden = YES;
            }else{
                cell.cellOptionCustomView.hidden = NO;
            }
        }
        
        if(passItem.showCustomView){
            passItem.showCustomView(passItem,cell.cellOptionCustomView);
        }
    }];
    return item;
}
/// 自定义视图 充满cell 有左右间距
YHOptionTableViewItemCustomStyle * YHOptionTableItemInitTitleCustomViewFullSpace15(NSString * _Nullable title, CGFloat height){
    return YHOptionTableItemInitTitleCustomView(title, NO, YES, height);
}
/// 充满整个cell
YHOptionTableViewItemCustomStyle * YHOptionTableItemInitTitleCustomViewFullFill(CGFloat height){
    return YHOptionTableItemInitTitleCustomView(nil, YES, NO, height);
}

@implementation YHOptionLayoutItemStyles

@end
